<?
layout("/inc/win_layout.html",{title:sysTitle}){}
    ?>

<div class="page-content">
<input type="hidden" value="${baikeip}" id="baikeip" name="baikeip"/>
		<table
			class="table table-hover table-striped table-bordered table-advanced tablesorter mbn">
			<thead>
				<tr>
					<th >序号</th>
					<th >分类号</th>
					<th >名称</th>
					<th >数据来源</th>
					<th >日期</th>
					<th >版本号</th>
					<th >操作</th>
				</tr>
			</thead>
			<tbody id="findUser">
			
			</tbody>
		</table>
		<div id="page2" style="text-align: center; margin-top: 20px;"></div>
	</div>
<script type="text/javascript">
	var historyId = window.parent.gethistoryId();
	var curr;
	
	$(function()  {
		queryhistory(1);
	});
	function queryhistory(curr){
		$.ajax({
			type : "post",
			url : "queryBaiKeHistory.do",
			dataType : "json",
			data :{
				"historyId" : historyId,
				"curr" : curr || 1,
			},
			beforeSend : function(XMLHttpRequest) {
			},
			success : function(res){
				var str = "";
				for ( var i = 0; i < res[0].BaikeEntryVersion.length; i++) {
					str += "<tr><td>" 
							+(i + 1)
							+ "</td><td>"
							+ res[0].BaikeEntryVersion[i].sid
							+ "</td><td>"
							+ res[0].BaikeEntryVersion[i].title
							+ "</td><td>"
							+ res[0].BaikeEntryVersion[i].source
							+ "</td><td>"
							+ res[0].BaikeEntryVersion[i].date
							+ "</td><td>"
							+ res[0].BaikeEntryVersion[i].version
							+ "</td><td>"
							+ "<button type=\"button\" class=\"btn btn-default btn-xs\"  onclick=\"historyDetails('"+res[0].BaikeEntryVersion[i].id+ "')\">"
							+ "查看详情"
							+ "</button>"
							+ "</td>"
							+ "</tr>";
				}
				$("#findUser").html(str);
					laypage({
					cont : document.getElementById('page2'), //容器。值支持id名、原生dom对象，jquery对象,
					pages : res[0].page, //总页数
					skip : true, //是否开启跳页
					skin : 'molv', //加载内置皮肤，也可以直接赋值16进制颜色值，如:#c00
					curr: curr || 1,
					last: res[0].page,
					groups : 6,//连续显示分页数
					jump : function(obj, first) { //触发分页后的回调
						if (!first) { //点击跳页触发函数自身，并传递当前页：obj.curr
							queryhistory(obj.curr);
							 curr = obj.curr;
						}
					}
				});
			}
		});
	
	}

	function historyDetails(DetailsId){
		var ip = $("#baikeip").val();
		window.open(ip+"detailsIdContent.html?id="+DetailsId);
	}
</script>
